package com.tbit.uqbike.webmanager.dao.log;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.tbit.config.datasource.DataSource;
import com.tbit.uqbike.object.pojo.SubAccountWithdrawalLog;
import com.tbit.uqbike.object.pojo.vo.RefundAdapayRecordVO;
import com.tbit.uqbike.object.pojo.vo.SubAccountRefundLogVO;
import com.tbit.uqbike.object.pojo.vo.SubAccountWithdrawalLogVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 用户分账日志Dao
 *
 * @Author:BUGTian
 * @DATE: 2022/5/26
 */
@DS(DataSource.LOG)
public interface SubAccountLogDao {


    /**
     * 根据退款订单号查询退款详情
     *
     * @param paymentId
     * @return
     */
    List<SubAccountRefundLogVO> queryRefundDetail(@Param("paymentId") String paymentId);

    /**
     * 插入提现日志
     *
     * @param subAccountWithdrawalLog
     */
    void insertSubAccountWithdrawalLog(SubAccountWithdrawalLog subAccountWithdrawalLog);

    /**
     * 查询提现日志
     *
     * @param accountId
     * @param startTime
     * @param endTime
     * @param accountUserPhone
     * @param subAccountId
     * @param schedule
     * @return
     */
    List<SubAccountWithdrawalLogVO> queryWithdrawalLog(@Param("accountId") Integer accountId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("accountUserPhone") String accountUserPhone, @Param("subAccountId") Integer subAccountId, @Param("schedule") Integer schedule, @Param("type")Integer type);

    /**
     * 更新提现日志状态
     *
     * @param withdrawalOrderNO
     * @param schedule
     */
    void updateSubAccountWithdrawalLog(@Param("withdrawalOrderNO") String withdrawalOrderNO, @Param("schedule") Integer schedule);

    /**
     * 查询分账退款详情（新表）
     * @param startTime 开始时间
     * @param endTime 结束时间
     * @param brandId 品牌id
     * @param areaId 区域id
     * @param userNO 账户编号
     * @param rechargeNO 业务订单号
     * @param adapayNO 汇付订单号
     * @return 退款详情
     */
    List<RefundAdapayRecordVO> queryRefundAdapayRecord(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("brandId") Integer brandId, @Param("areaId") Integer areaId, @Param("userNO") String userNO, @Param("rechargeNO") String rechargeNO, @Param("adapayNO") String adapayNO);


}
